﻿using ControlFocusWin.WinUtilApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ControlFocusWin.Biz
{
    public class MouseBiz
    {
        public const int MOUSEEVENTF_LEFTDOWN = 0x0002;
        //模拟鼠标左键抬起 
        public const int MOUSEEVENTF_LEFTUP = 0x0004;

        public static void MouseLeftClick(int xCoor, int yCoor)
        { 
            //Win32MouseApi.mouse_event((int)(MouseEventFlags.LeftDown | MouseEventFlags.LeftUp), xCoor, yCoor, 0, 0);
            Win32MouseApi.mouse_event((int)(MouseEventFlags.LeftDown | MouseEventFlags.LeftUp), 0, 0, 0, 0);
        }
    }

    public enum MouseEventFlags
    {
        Move = 0x0001,
        LeftDown = 0x0002,
        LeftUp = 0x0004,
        RightDown = 0x0008,
        RightUp = 0x0010,
        MiddleDown = 0x0020,
        MiddleUp = 0x0040,
        Wheel = 0x0800, Absolute = 0x8000
    }
}
